//
//  XDPlaceDetailsRegionCollectionViewCell.m
//  Le way walkers
//
//  Created by YaZhiLiang on 15/5/18.
//  Copyright (c) 2015年 LTXZ. All rights reserved.
//

#import "XDPlaceDetailsRegionCollectionViewCell.h"

@interface XDPlaceDetailsRegionCollectionViewCell ()

@property (nonatomic, retain) UIImageView *myimageView;

@end

@implementation XDPlaceDetailsRegionCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.myimageView = [[UIImageView alloc]init];
        
        [self.contentView addSubview:self.myimageView];
        
        [_myimageView release];
        
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    self.myimageView.frame = CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.bounds.size.height);
    
    self.myimageView.userInteractionEnabled = YES;
    
}


- (void)setXdPlaceCityModel:(XDPlaceCityModel *)xdPlaceCityModel
{
    if (_xdPlaceCityModel !=  xdPlaceCityModel) {
        
        [_xdPlaceCityModel release];
        
        _xdPlaceCityModel = [xdPlaceCityModel retain];
    }
    
    [self.myimageView sd_setImageWithURL:[NSURL URLWithString:xdPlaceCityModel.photo_s] placeholderImage:[UIImage imageNamed:@"69E58PIChJC_1024.jpg"]];
    
}

@end
